package ro.msg.office.ticketmanager.DO;

import java.util.Date;

public class TicketDO {

	private Long ticketId;
	private Date startTime;
	private Date endTime;
	private Long status;
	private String statusString;
	private String description;
	private Date approvalDate;
	private Date creationDate;
	private String rejected;
	private Long userID;
	private String userName;
	public TicketDO(){}


	public TicketDO(Long id, Date startTime, Date endTime, Long status, String statusString,
			String description, Date approvalDate, Date creationDate,
			Long userID,String userName) {
		super();
		this.ticketId = id;
		this.startTime = startTime;
		this.endTime = endTime;
		this.status = status;
		this.statusString = statusString;
		this.description = description;
		this.approvalDate = approvalDate;
		this.creationDate = creationDate;
		this.userID = userID;
		this.userName = userName;
	}

	public String getStatusString() {
		return statusString;
	}

	public void setStatusString() {
		long status = getStatus();
		String statusString = "";
		switch((int)status){
		case 0: statusString = "draft";
			break;
		case 1: statusString = "pending";
			break;
		case 2: statusString = "accepted";
			break;
		case 3: statusString = "rejected";
			break;
		case 4: statusString = "more details";
			break;
		default: statusString = "invalid option";
		}
		this.statusString = statusString;
	}

	public String getUserName() {
		return userName;
	}
	public void setUserName(String userName) {
		this.userName = userName;
	}
	public Long getTicketId() {
		return ticketId;
	}
	public void setTicketId(Long id) {
		this.ticketId = id;
	}
	public Date getStartTime() {
		return startTime;
	}
	public void setStartTime(Date startTime) {
		this.startTime = startTime;
	}
	public Date getEndTime() {
		return endTime;
	}
	public void setEndTime(Date endTime) {
		this.endTime = endTime;
	}
	public Long getStatus() {
		return status;
	}
	public void setStatus(Long status) {
		this.status = status;
	}
	public String getDescription() {
		return description;
	}
	public void setDescription(String description) {
		this.description = description;
	}
	public Date getApprovalDate() {
		return approvalDate;
	}
	public void setApprovalDate(Date approvalDate) {
		this.approvalDate = approvalDate;
	}
	public Date getCreationDate() {
		return creationDate;
	}
	public void setCreationDate(Date creationDate) {
		this.creationDate = creationDate;
	}

	public String getRejected(){
		return rejected;
	}

	public void setRejected(String rejected){
		this.rejected = rejected;
	}

	public Long getUserID() {
		return userID;
	}
	public void setUserID(Long userID) {
		this.userID = userID;
	}

}